1. Field
This invention pertains to the field of image processing, and more particularly, to method and decoding image data.
2. Description
Data representing an image is often encoded to reduce the memory storage requirements for storing the image data and/or the bandwidth requirements for communicating the image. A number of standards have been developed for image encoding. Probably the most common standard is the standard created by the Joint Photographic Experts Group (JPEG). JPEG is a commonly used method of compression for photographic images. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality. JPEG compression is used in a number of image file formats. JPEG/Exif is the most common image format used by digital cameras and other photographic image capture devices; along with JPEG/JFIF, it is the most common format for storing and transmitting photographic images on the World Wide Web. These format variations are often not distinguished, and are all simply called JPEG.
In a typical implementation, the original image data is split into three channels (Y, Cb and Cr) and, after downsampling, each channel is processed separately by splitting the data of each channel into blocks of N×N (e.g., 8×8) pixels (sometimes called minimum coded units (MCUs)), performing a Discrete Cosine Transform (DCT) on each block of pixels, quantizing the DCT coefficients according to a quantization matrix, and entropy encoding the quantized DCT coefficients, including Huffman coding. JPEG encoding and decoding are well known in the art, and so for brevity further details will not be presented here. In some cases, coded image data (e.g., JPEG coded image data) having a first pixel resolution must be scaled for display on a target display device having a different pixel resolution. Also, in some cases it is desired to “zoom” into a portion of the image and display the zoomed portion of the image on a display device.
FIG. 1 illustrates an arrangement 100 for decoding and scaling a JPEG image for display. FIG. 1 shows a source 110 of coded image data, a JPEG decoder 120, a first memory 130, a scaler 140, a second memory 150, and a display device 160.
A description will now be provided of an example of a process of decoding and resizing image data for display on a display device having a particular pixel resolution. In this example, assume that source 110 provides an original, high quality encoded image having a pixel resolution of 4000×3000 pixels, and this encoded image is decoded by JPEG decoder 120 and stored to first memory 130. Scaler 140 scales the image data in first memory 130 to be adapted to the resolution of display device 160, and stores the scaled data in second memory 150.
In this example, first memory 130 must be of a sufficient size to store the decoded image, and this may require up to 18 Mbytes of memory. In general, as the quality and pixel resolution of the encoded source image are increased, the size of first memory 130 must be increased.
Meanwhile, in the process of zooming an image for display, generally one of two methods in used.
The first method scale ups the image with an interpolation method for the display size. This provides a fast zoom capability, but leads to a poor quality display because if a high resolution and high quality image is enlarged during a display process, then the image quality is degraded.
The second method decodes the image to have a bigger size than the display size, and displays that image for high quality with a special zoom ratio. However, with this method a new decoding process is required that also has a longer processing time and requires more memory capacity. And although there is nearly no downgrade of image quality in a low ratio zooming process with this method, there is a downgrade of image quality in a high ratio zooming process.
Accordingly, it would be desirable to provide a new decoding method that can address one or more of these shortcomings. It would be further desirable to provide a system that can execute such a decoding method.
The present invention is directed to a method and system for decoding image data.
In one aspect of the inventive concept, a device comprises: a controller configured to receive information for displaying at least a portion of an image, and in response thereto to generate a scale ratio K for scaling compressed image data corresponding to the image; a partial image decoder configured to receive the compressed image data and the scale ratio and in response thereto to decode and scale the compressed image data by the scale ratio K and to output a portion of the decoded and scaled image data, wherein the portion corresponds to an area of the image to be displayed on a display device; a frame buffer configured to store the portion of the decoded and scaled image data output by the partial image decoder; and a video processor configured to receive the data from the frame buffer and to further scale the data for display on the display device.
In another aspect of the inventive concept, a method comprising: receiving information for displaying at least a portion of an image, and in response thereto, generating a scale ratio K for scaling compressed image data corresponding to the image; partially decoding the compressed image data; fully decoding at least a portion of the partially decoded image data, wherein the portion corresponds to an area of the image to displayed on a display device; scaling the fully decoded image data by the scale ratio k; writing the portion of the decoded and scaled image data into a frame buffer; and video processing the data from the frame buffer and to further scale the data for display on the display device.
In yet another aspect of the inventive concept, a method comprising: receiving information for displaying at least a portion of an image, including information identifying a zoom function to be performed on the image; determining a zoomed area of the image to be displayed and a zoom ratio for the image; generating a scale ratio K, based on the zoom ratio, for scaling compressed image data corresponding to the image; partially decoding the compressed image data; fully decoding at least a portion of the partially decoded image data, wherein the portion corresponds to the zoomed area; scaling the fully decoded image data by the scale ratio K; writing the portion of the decoded and scaled image data into a frame buffer; and video processing the data from the frame buffer to further scale the data for display on the display device.
In still another aspect of the inventive concept, a method comprises: receiving information for displaying at least a portion of an image, including information identifying a zoom function to be performed on the image; determining a zoomed area of the image to be displayed and a zoom ratio for the image; generating a scale ratio K, based on the zoom ratio, for scaling compressed image data corresponding to the image; (a) partially decoding the compressed image data; (b) fully decoding at least a portion of the partially decoded image data, wherein the portion corresponds to the zoomed area; (c) scaling the fully decoded image data by the scale ratio K; (d) writing the portion of the decoded and scaled image data into a first frame buffer; further comprising, until step (d) is completed for the entire image, in parallel with steps (a)-(d):(e) storing fully decoded image data for the entire image in a second frame buffer; (f) scaling-up the fully decoded image data of the second frame buffer by interpolation, and (g) displaying the scaled-up image data, and when step (d) is completed for the entire image, stopping displaying the scaled-up image data from the second frame buffer, and instead displaying the decoded and scaled image data from the first frame buffer.
In a further aspect of the inventive concept, a method comprises: receiving information for displaying at least a portion of an image, including information identifying a zoom function to be performed on the image; determining a zoomed area of the image to be displayed and a zoom ratio m for the image; generating a scale ratio K, based on the zoom ratio m, for scaling compressed image data corresponding to the image; (a) partially decoding the compressed image data; (b) fully decoding at least a portion of the partially decoded image data, wherein the portion corresponds to the zoomed area; (c) scaling the fully decoded image data by the scale ratio K; (d) writing the portion of the decoded and scaled image data into a first frame buffer; further comprising, until step (d) is completed for the entire image, in parallel with steps (a)-(d): (e) storing fully decoded image data for the entire image in a second frame buffer; (f) scaling-up the fully decoded image data of the second frame buffer by interpolation using a zoom ratio m0, wherein initially m0<m, and (g) displaying the scaled-up image data, (h) determining whether m0<m, and when m0<m: (i) incrementing the zoom ratio m0 by m, (j) waiting a wait time, and (k) repeating steps (f)-(h); and when step (d) is completed for the entire image and m0>m, stopping displaying the scaled-up image data from the second frame buffer, and instead displaying the decoded and scaled image data from the first frame buffer.